package com.young.springdemo.service.prototypePattern;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//测试深度克隆
@Component
public class TestDeepClone {

//    @PostConstruct
    public void test(){
        DayLog dayLog,dayLogCopy;
        dayLog = new DayLog();
        Attachment attachment = new Attachment();
        dayLog.setAttachment(attachment);
        dayLogCopy = dayLog.clone();
        System.out.println(dayLog == dayLogCopy );
        System.out.println(dayLog.getAttachment() == dayLogCopy.getAttachment());
    }
}
